dt:<span>@(dt?.ToString("yyyy-MM-dd"))</span><br>
<DatePicker Color="Color.Danger" @bind-Value="dt" Options="opt"></DatePicker>

@code {
    DateTime? dt;

    DatePickerOptions opt = new()
    {
        StartDate = DateTime.Now.AddDays(-2),
        EndDate = DateTime.Now.AddDays(30),
        DatesDisabled = new[] {DateTime.Now.AddDays(1), DateTime.Now.AddDays(2)}
    };

}